package spec.zhangyuehua.$04.jiekou;

/**
 * Created by yue on 2017/10/19.
 */
public class PrintMessage implements IPrintMessage {
    int i=0;
    String[] message;
    public PrintMessage(){
        message =new String[3];
        this.putMessage("Hello word!");
        this.putMessage("Hello China");
        this.putMessage("Hello JIANGYOU");
    }
    void putMessage(String str){
      message[i++]=str;
    }
    @Override
    public void printAllMessage() {
        for (int j=0;j<message.length;j++) {
            System.out.println(message[j]);
        }
    }
    @Override
    public void printLastMessage() {
        System.out.println(message[message.length-1]);
    }

    @Override
    public void printFristMessage() {
        System.out.println(message[0]);
    }
}
